<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function ajax() {
        return new Promise((resolve, reject) => {
            reject('err-111111')
        })
    }

    ajax().then((data) => {
        console.log(data)
    }).catch(err => {
        console.log('err', err)
    }).finally((data) => { // 无论成功与失败
        console.log("finally", data)
        // 关闭一些对话框
        // 清除一些缓存 ....
    })
</script>
</body>
</html>
